package com.kof.userregister.action;

import java.util.Date;

import javax.annotation.Resource;

import com.kof.userregister.dao.UserDao;
import com.kof.userregister.entity.User;
import com.kof.userregister.service.UserService;
import com.opensymphony.xwork2.ActionSupport;

public class RegisterAction extends BaseAction {

	
	private static final long serialVersionUID = 6158548845353703136L;
	
	private User user;
	@Resource
	private UserService userService;

	@Override
	public String doDefault() throws Exception {
		// TODO Auto-generated method stub
		return INPUT;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		user.setRegDate(new Date());
		userService.saveUser(user);
		return SUCCESS;
	}

	

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	

	
}
